﻿using System;
using System.Linq;
using System.Web.Mvc;
using ProjetoComperio.Framework.Web.Logging;
using ProjetoComperio.Framework.Web.Security.UrlEncrypt;

namespace ProjetoComperio.Presentation.Web.Controllers
{
    public class ExceptionLoggingController : Controller
    {

        public ExceptionLoggingController()
        {

        }
        public ActionResult Index()
        {
            ViewData.Model = Logger.RetrieveExceptions().AsQueryable();
            return View();
        }

        public ActionResult Visualize(String id)
        {
            Session["id"] = id;
            var entity = Logger.RetrieveException(Convert.ToInt32(URLEncrypt.DecryptFromString(id)));
            return View(entity);
        }


    }
}
